<div class="admin-content">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf">
			<strong class="am-text-primary am-text-lg">日结订单</strong> / <small>GroupOrder</small>
		</div>
	</div>

	<div class="am-cf am-padding am-u-sm-12 am-form-inline am-u-end">
		<div class="am-u-sm-6">
			<label>日期：</label>
			<div class="am-input-group am-datepicker-date">
				<input datepicker readonly id="birthday_input" type="text" select="checkDate" class="am-form-field" ng-model="birthday">
			</div>
			<br class="am-show-sm-only" />
			<button class="am-btn am-btn-primary" data-ng-click="check()">确定</button>
		</div>
	</div>

	<div class="am-padding am-u-sm-11 am-u-md-6 am-u-end">
		<table class="am-table am-table-striped  am-table-bordered">
			<thead>
				<tr>
					<th>类型</th>
					<th>金额(元)</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>订单</td>
					<td>{{ statisticsInfo.omoney }}</td>
				</tr>
				<tr>
					<td>团订单</td>
					<td>{{ statisticsInfo.gmoney }}</td>
				</tr>
				<tr>
					<td>代金券订单</td>
					<td>{{ statisticsInfo.tmoney }}</td>
				</tr>
				<tr>
					<td>总计</td>
					<td>{{ statisticsInfo.tmoney+statisticsInfo.gmoney +statisticsInfo.omoney }}</td>
				</tr>
			</tbody>
		</table>
	</div>

	<hr class="am-u-sm-12" />

	<div class="am-padding">
		<ul class="am-avg-sm-4 am-avg-md-8 am-avg-lg-12 am-thumbnails">
			<li data-ng-repeat="store in stores"><label class="am-badge am-text-default" data-ng-class="{'am-badge-success':(store.id == $parent.selectedStore)}"> <span data-ng-bind="store.name"></span> <input type="radio" id="{{ store.id }}" name="options" data-ng-model="$parent.selectedStore" data-ng-value="store.id">
			</label></li>
		</ul>
	</div>

	<div class="am-cf am-padding am-u-sm-12 am-form-inline am-u-end">
		<div class="am-u-sm-6">
			<label>日期：</label>
			<div class="am-input-group am-datepicker-date">
				<input datepicker readonly id="birthday_input2" type="text" select="checkDate" class="am-form-field" ng-model="birthday">
			</div>
			<br class="am-show-sm-only" />
			<button class="am-btn am-btn-primary" data-ng-click="check2()">确定</button>
		</div>
	</div>


	<div class="am-padding am-u-sm-12 am-u-md-6 am-u-end">
		<table class="am-table am-table-striped am-table-bordered">
			<thead>
				<tr>
					<th>类型</th>
					<th>数量</th>
					<th>金额(元)</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>订单</td>
					<td>{{ storeStatisticsO[1] }}</td>
					<td>{{ storeStatisticsO[2] }}</td>
				</tr>
				<tr>
					<td>团订单</td>
					<td>{{ storeStatisticsG[1] }}</td>
					<td>{{ storeStatisticsG[2] }}</td>
				</tr>
				<tr>
					<td>代金券订单</td>
					<td>{{ storeStatisticsT[1] }}</td>
					<td>{{ storeStatisticsT[2] }}</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td>总计</td>
					<td>{{ 1*storeStatisticsO[1]+storeStatisticsG[1]*1+storeStatisticsT[1]*1  }}</td>
					<td>{{ storeStatisticsMoney  }}</td>
				</tr>
			</tfoot>
		</table>
	</div>
	<div class="am-padding am-u-sm-12 am-u-md-6 am-u-end ">
		<label class="am-badge am-badge-danger am-text-lg">{{ storeStatistics.atmed? "已发钱":"未发钱" }}</label>
		<p></p>
		<button class="am-btn" data-ng-class="{'am-hide':storeStatistics.atmed}" data-ng-click="showPay()">点击付款</button>
	</div>

	<hr class="am-u-sm-12" />

	<div class="am-cf am-padding am-u-sm-12 am-form-inline am-u-end">
		<div class="am-u-sm-6">
			<label>日期：</label>
			<div class="am-input-group am-datepicker-date">
				<input datepicker readonly id="birthday_input3" type="text" select="checkDate" class="am-form-field" ng-model="birthday">
			</div>
			<br class="am-show-sm-only" />
			<button class="am-btn am-btn-primary" data-ng-click="check3()">确定</button>
		</div>
	</div>

	<div class="am-u-sm-12 am-padding am-table-bordered am-u-sm-center">
		<table class="am-table am-table-striped am-table-hover">
			<thead>
				<tr>
					<th>id</th>
					<th>总金额</th>
					<th>订单类型</th>
					<th>操作店长</th>
					<th>提货时间</th>
				</tr>
			</thead>
			<tbody>
				<tr data-ng-repeat="order in dataStatistics.0.currentPageItems">
					<td>{{ order.id }}</td>
					<td>{{ order.money }}</td>
					<td>{{ order.orderType }}</td>
					<td>{{ order.operator }}</td>
					<td>{{ order.bufferTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
					<td>
						<div class="am-btn-toolbar">
							<div class="am-btn-group am-btn-group-xs am-btn-group-justify">
								<button class="am-btn am-round am-btn-default  am-btn-xs am-text-warning" data-ng-click="edit(order)">
									<span class="am-icon-pencil-square-o"></span>查看
								</button>
							</div>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="am-cf" data-ng-model="total">
			共&nbsp;{{dataStatistics.0.recordCount}}&nbsp;条记录,&nbsp;共&nbsp;{{ dataStatistics.0.pages }}&nbsp;页
			<div class="am-fr">
				<ul class="am-pagination">
					<li class="{{ dataStatistics.0.currentPage-1>0 ? 'am' : 'am-disabled' }}"><a href="javascript:void(0);" disabled="{{!page.hasPrePage}}" data-ng-click="dataStatistics.0.previous()">上一页</a></li>
					<li class="am-disabled"><a href="javascript:void(0);">{{ dataStatistics.0.recordCount!="0"? dataStatistics.0.currentPage : 0 }}</a></li>
					<li class="{{ dataStatistics.0.currentPage+1<=dataStatistics.0.pages? 'am' : 'am-disabled' }}"><a href="javascript:void(0);" data-ng-click="dataStatistics.0.next()">下一页</a></li>
				</ul>
			</div>
		</div>
	</div>
</div>
<script>
	$(function() {
		var nowTemp = new Date();
		var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
		var $myStart2 = $('#birthday_input');
		var $myStart3 = $('#birthday_input2');
		var $myStart4 = $('#birthday_input3');

		var month = nowTemp.getMonth() + 1;
		var date = nowTemp.getDate();
		var value = nowTemp.getFullYear() + "-" + (month < 10 ? ("0" + month) : month) + "-" + (date < 10 ? ("0" + date) : date);
		$myStart2.val(value);
		$myStart3.val(value);
		$myStart4.val(value);

		var checkin = $myStart2.datepicker({
			onRender : function(date) {
				return date.valueOf() > now.valueOf() ? 'am-disabled' : '';
			}
		});
		var checkin = $myStart3.datepicker({
			onRender : function(date) {
				return date.valueOf() > now.valueOf() ? 'am-disabled' : '';
			}
		});
		var checkin = $myStart4.datepicker({
			onRender : function(date) {
				return date.valueOf() > now.valueOf() ? 'am-disabled' : '';
			}
		});
	});
</script>
<!-- content end -->
<!-- 侧边栏内容 草稿内容 -->
<div id="new_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>


								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<!-- ticket -->
<div id="ticket_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>


								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew2()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<!-- group -->
<div id="group_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">团详情：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<button class="am-btn am-btn-xs" data-am-collapse="{target: '#groupOrder'}">
											详情 <i class="am-icon-bars"></i>
										</button>
										<div id="groupOrder" class="am-collapse am-vertical-align">
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												&nbsp;&nbsp;&nbsp;产品： <span data-ng-bind="norder.group.product.description"></span>
											</h4>
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团购价：￥ <span>{{ norder.money+"元" }}</span>
												<del>
													原价：￥<span>{{ norder.group.product.price }}</span>
												</del>
											</h4>
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团类型：<span>{{ norder.group.personAmount+"人团" }}</span>
											</h4>
										</div>
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">团成员：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<button class="am-btn am-btn-xs" data-am-collapse="{target: '#groupOwner'}">
											详情 <i class="am-icon-bars"></i>
										</button>
										<div id="groupOwner" class="am-collapse am-vertical-align am-in">
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团长： <span>{{ norder.groupInstance.captain.phone }}</span> <br class="am-sm-show-only" />
											</h4>
											<div data-ng-repeat="groupOwner in groupOwners">
												<hr />
												<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
													<span>{{ groupOwner.phone }}</span>
												</h4>
												<br class="am-sm-show-only" />
												<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
													下单时间： <span>{{ groupOwner.phone | date : 'yyyy-MM-dd HH:mm:ss' }}</span> <br class="am-sm-show-only" />
												</h4>
											</div>
										</div>
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>



								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew3()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>

		</div>
	</div>
</div>
<div class="am-modal am-modal-confirm am-modal-out" tabindex="-1" id="my-confirm" style="display: none; margin-top: -66px;">
	<div class="am-modal-dialog">
		<div class="am-modal-hd">警 告</div>
		<div class="am-modal-bd">你，确定要付款吗？</div>
		<div class="am-modal-footer">
			<span class="am-modal-btn" data-am-modal-cancel>取消</span> <span class="am-modal-btn" data-am-modal-confirm>确定</span>
		</div>
	</div>
</div>